package com.wicket.okrapp.biz.service.nb;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrapp.common.baseinfo.BaseInfoDO;
import com.wicket.okrapp.common.baseinfo.BaseInfoHolder;
import com.wicket.okrapp.common.util.CommonFunctionHelper;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;
import com.wicket.okrapp.biz.service.dto.req.CalculateAcceptAboveFieldsReqDto;
import com.wicket.okrapp.biz.service.dto.res.CalculateAcceptAboveFieldsRespDto;
import com.wicket.okrapp.biz.service.dto.req.ImplementBizPublicFieldPushMemoryReqDto;
import com.wicket.okrapp.biz.service.dto.res.ImplementBizPublicFieldPushMemoryRespDto;
import com.wicket.okrapp.biz.service.dto.req.ImplementAcceptFieldReqDto;
import com.wicket.okrapp.biz.service.dto.res.ImplementAcceptFieldRespDto;
import com.wicket.okrapp.biz.service.dto.req.ImplementElevenReceivingFieldReqDto;
import com.wicket.okrapp.biz.service.dto.res.ImplementElevenReceivingFieldRespDto;

/**
 * @author ： 手工接入方法
 * @since 2022/5/28 15:32
 *
 *
 * @version 1.0
 */
@Service
public class NbGridCalculate {
/**
      * code:receptionService
      * name:满足循环发牌
      * desc:undefined
      * gen by moon at 5/9/2023, 5:47:43 AM
      * 
      **/
     @Trace(operationName = "满足循环发牌")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public CalculateAcceptAboveFieldsRespDto calculateAcceptAboveFields(CalculateAcceptAboveFieldsReqDto reqDto) {
         return BeanUtil.toBean(reqDto,CalculateAcceptAboveFieldsRespDto.class);
      }
/**
      * code:publicFieldCache
      * name:M3业务应用公共字段推送内存
      * desc:undefined
      * gen by moon at 6/1/2023, 2:42:34 AM
      *
      **/
     @Trace(operationName = "M3业务应用公共字段推送内存")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public ImplementBizPublicFieldPushMemoryRespDto implementBizPublicFieldPushMemory(ImplementBizPublicFieldPushMemoryReqDto reqDto) {
         BaseInfoDO domain = new BaseInfoDO();
         if(BaseInfoHolder.contextHolder.get()!=null){
             BeanUtil.copyProperties(BaseInfoHolder.contextHolder.get().getBaseInfo(),domain);
             BaseInfoHolder.contextHolder.remove();
         }
         if(reqDto.getSpaceId()!=null){
             domain.setSpecSpaceId(reqDto.getSpaceId());
         }

         if(reqDto.getCreateInductionId()!=null){
             domain.setSpecInductionRecordId(reqDto.getCreateInductionId());
         }

         if(reqDto.getAppId()!=null){
             domain.setSpecAppId(reqDto.getAppId());
         }

         CommonFunctionHelper.setBaseInfoToLocal(domain);
         return new ImplementBizPublicFieldPushMemoryRespDto();
      }
/**
      * code:receptionService
      * name:M3接收上文出参字段
      * desc:undefined
      * gen by moon at 6/15/2023, 7:48:29 PM
      *
      **/
     @Trace(operationName = "M3接收上文出参字段")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public ImplementAcceptFieldRespDto implementAcceptField(ImplementAcceptFieldReqDto reqDto) {
         return BeanUtil.toBean(reqDto,ImplementAcceptFieldRespDto.class);

      }
/**
      * code:receptionService
      * name:M3约定父中子过程周期类型
      * desc:undefined
      * gen by moon at 9/12/2024, 7:18:31 PM
      *
      **/
     @Trace(operationName = "M3约定父中子过程周期类型")
     @Tags({@Tag(key = "参数",value = "arg[0]"),
     @Tag(key = "返回值",value = "returnedObj")})
      public ImplementElevenReceivingFieldRespDto implementElevenReceivingField(ImplementElevenReceivingFieldReqDto reqDto) {
         return BeanUtil.toBean(reqDto,ImplementElevenReceivingFieldRespDto.class);
      }
  //手工接入方法
}
